const otherPage = [
	{
		"path": "pages/other/about_us", //关于我们
		"style": {}
	}, {
		"path": "pages/other/set", //个人设置
		"style": {}
	}, {
		"path": "pages/other/notice", //平台公告
		"style": {}
	}, {
		"path": "pages/other/external_page", //网页链接
		"style": {}
	}, {
		"path": "pages/other/address", //地址管理
		"style": {}
	}, {
		"path": "pages/other/address_info", //地址管理-新增编辑
		"style": {}
	}, {
		"path": "pages/other/document", //文档详情
		"style": {}
	}, {
		"path": "pages/other/ad_info", //广告图片
		"style": {}
	}, {
		"path": "pages/other/video", //video
		"style": {}
	}
]
const loginPage = [
	{
		"path": "pages/login/login_psd", //密码登陆
		"style": {}
	}, {
		"path": "pages/login/find_psd", //找回/修改密码
		"style": {}
	}, {
		"path": "pages/login/find_pay_psd", //修改-支付密码
		"style": {}
	}, {
		"path": "pages/login/register", //注册
		"style": {}
	}
]
const minePage = [
	{
		"path": "pages/mine/index", //我的
		"style": {}
	}, {
		"path": "pages/mine/team", //我的团队
		"style": {}
	}, {
		"path": "pages/mine/info", //个人信息
		"style": {}
	}, {
		"path": "pages/mine/invite", //邀请
		"style": {}
	}, {
		"path": "pages/mine/log", //日志
		"style": {}
	}, {
		"path": "pages/mine/realname", //实名认证
		"style": {}
	}
]
module.exports = (pagesJson) => {

	const appPages = [
		{
			"path": "pages/home/index", //home首页
			"style": {}
		},
		{
			"path": "pages/index/index", //首页
			"style": {}
		},
		...loginPage,
		...otherPage,
		...minePage,
		{
			"path": "pages/businessSchool/index", //商学院
			"style": {}
		},
		{
			"path": "pages/spellTeam/index", //拼团
			"style": {}
		},
		{
			"path": "pages/mine/bind",
			"style": {}
		},{
			"path": "pages/mine/recharge",
			"style": {}
		},{
			"path": "pages/mine/withdrawal",
			"style": {}
		},{
			"path": "pages/mine/tuanz",
			"style": {}
		},{
			"path": "pages/mine/tuanz_manage",
			"style": {}
		},{
			"path": "pages/order/ping_official_order",
			"style": {}
		},{
			"path": "pages/order/ping_self_order",
			"style": {}
		},{
			"path": "pages/store/join",
			"style": {}
		},{
			"path": "pages/ping/local",
			"style": {}
		},{
			"path": "pages/index/good_order",
			"style": {}
		},{
			"path": "pages/index/good_info",
			"style": {}
		},{
			"path": "pages/agentStore/index",
			"style": {}
		},{
			"path": "pages/agentStore/send",
			"style": {}
		},{
			"path": "pages/ping/list",
			"style": {}
		},{
			"path": "pages/crystalGoods/list",
			"style": {}
		}
	];

	const pcPages = [{
		"path": "pages/login/register", //注册
		"style": {}
	}, {
		"path": "pages/other/document", //文档
		"style": {}
	}, {
		"path": "pages/other/ad_info", //广告图片
		"style": {}
	}];

	let nowpages = [];
	if (process.env.VUE_APP_PLATFORM == 'h5') {
		console.log(process.env.NODE_ENV);
		if (process.env.NODE_ENV == 'development') {
			nowpages = appPages.concat(pcPages);
		} else {
			nowpages = pcPages;
		}
	} else if (process.env.VUE_APP_PLATFORM == 'app-plus') {
		nowpages = appPages;
	}
	nowpages.forEach(li => {
		li.style['app-plus'] = {
			"bounce": "none", //关闭窗口回弹效果
		}
	})
	console.log('nowpages:P', nowpages);

	return {
		// 合并pages.json的内容  
		pages: nowpages,
		"globalStyle": {
			"titleNView": false,
			"navigationBarTitleText": "利商网",
			"navigationBarTextStyle": "black"
		},
		"tabBar": {
			"color": "#C8C8C8",
			"selectedColor": "#333333",
			"borderStyle": "white",
			"backgroundColor": "#ffffff",
			"list": [{
				"pagePath": "pages/home/index",
				"iconPath": "static/tabbar/img_1.png",
				"selectedIconPath": "static/tabbar/img_1.png",
				"text": "拼"
			},
			{
				"pagePath": "pages/ping/local",
				"iconPath": "static/tabbar/img_1.png",
				"selectedIconPath": "static/tabbar/img_1.png",
				"text": "发"
			},
			{
				"pagePath": "pages/businessSchool/index",
				"iconPath": "static/tabbar/img_1.png",
				"selectedIconPath": "static/tabbar/img_1.png",
				"text": "商"
			},
			{
				"pagePath": "pages/mine/index",
				"iconPath": "static/tabbar/img_1.png",
				"selectedIconPath": "static/tabbar/img_1.png",
				"text": "我"
			}]
		},
		"easycom": {
			"^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)": "uni_modules/z-paging/components/z-paging$1/z-paging$1.vue"
		}
	}
}